import { $navTo, $redBack, $navBack, $reLaunch, $switchTab } from './router'
import { fmtDict, isNull, fmtNumToFixed, fmtMutilSelect } from './filter'
import { showToast, showLoading } from './showToast'

export default {
  install(Vue: any) {
    Vue.prototype.$navTo = $navTo
    Vue.prototype.$redBack = $redBack
    Vue.prototype.$navBack = $navBack
    Vue.prototype.$reLaunch = $reLaunch
    Vue.prototype.$switchTab = $switchTab

    Vue.prototype.$showToast = showToast
    Vue.prototype.$showLoading = showLoading

    Vue.filter('fmtDict', fmtDict)
    Vue.filter('isNull', isNull)
    Vue.filter('fmtNumToFixed', fmtNumToFixed)
    Vue.filter('fmtMutilSelect', fmtMutilSelect)
  }
}
